package com.Dec_Three;

import java.util.Arrays;

public class Solution455 {

    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int index=s.length-1,result=0;
        for (int i = g.length-1; i >=0 ; i--) {
            if (index>=0&&s[index]>=g[i])
            {
                index--;
                result++;
            }
        }
        return result;
    }

    public static void main(String[] args) {
        Solution455 solution455=new Solution455();
        System.out.println(solution455.findContentChildren(new int[]{1,2,3},new int[]{1,1}));
    }

}
